package com.ruoyi.system.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * @author nanyang
 */
public class TFlupStrategyVo implements Serializable {

    @Data
    @ApiModel("项目管理")
    public class Result{
        @ApiModelProperty("id")
        private Long id;
        @ApiModelProperty("类别（基层筛查、住院干预）")
        private Byte type;
        @ApiModelProperty("危险分级")
        private Byte riskLevel;
        @Excel(name = "随访轮次")
        @ApiModelProperty("随访轮次")
        private String round;
        @Excel(name = "策略内容")
        @ApiModelProperty("策略内容")
        private String content;
        @ApiModelProperty("创建者")
        private String createBy;
        @ApiModelProperty(" 创建时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date createTime;
        @ApiModelProperty("更新者")
        private String updateBy;
        @ApiModelProperty(" 修改时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date updateTime;
        @Excel(name = "类别")
        @ApiModelProperty("类别（基层筛查、住院干预）")
        private String typeString;
        @Excel(name = "危险分级")
        @ApiModelProperty("危险分级")
        private String riskLevelString;

        public String getTypeString() {
            if (type != null) {
                if (type == 1) {
                    return "基层筛查";
                }
                if (type == 2) {
                    return "住院干预";
                }
            }
            return null;
        }

        public String getRiskLevelString() {
            if (riskLevel != null) {
                if (riskLevel == 0) {
                    return "未分级";
                }
                if (riskLevel == 1) {
                    return "低危";
                }
                if (riskLevel == 2) {
                    return "中危";
                }
                if (riskLevel == 3) {
                    return "高危";
                }
                if (riskLevel == 4) {
                    return "TIA";
                }
                if (riskLevel == 5) {
                    return "卒中";
                }
            }
            return null;
        }
    }

}